package O2.basic;

public class Calculate {

    public static void main(String[] args) {
        int i = (100 + 200) * (99 - 88); // 3300
        int n = 7 * (5 + (i - 9)); // 23072
        System.out.println(i);
        System.out.println(n);
        System.out.println(12345%67);

        // overflow
        int x = 2147483640;
        int y = 15;
        int sum = x + y;
        System.out.println(sum); // -2147483641

        long x1 = 2147483640;
        long y1 = 15;
        long sum1 = x1 + y1;
        System.out.println(sum1); // 2147483655

        System.out.println(--sum1);
        System.out.println(sum1++);
        System.out.println(++sum1);

        int end = 100;
        int mul = 0;
        mul = (end+1)*end / 2;
        System.out.println(mul);
        System.out.println(mul == 5050 ? "测试通过" : "测试失败");

    }
}
